package com.example.weathernow;

import android.app.ListActivity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainActivity extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		TabHost tabHost = getTabHost();

		TabSpec albumspec = tabHost.newTabSpec("Album");
		albumspec.setIndicator("Album");
		Intent albumIntent = new Intent(this, AlbumActivity.class);
		albumspec.setContent(albumIntent);
		
		TabSpec cameraspec = tabHost.newTabSpec("Camera");
		cameraspec.setIndicator("Camera");
		Intent cameraIntent = new Intent(this, CameraActivity.class);
		cameraspec.setContent(cameraIntent);
		
		tabHost.addTab(cameraspec); 
		tabHost.addTab(albumspec); 
        
		Intent in = getIntent();
		if (in != null) {
			Bundle extras = in.getExtras();
			 
	         if(  extras != null )
	         {
	         //Do Something here...
	        	 tabHost.setCurrentTab(1);
	         }
	         else{}
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
